<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>JSSpec results</title>
<link rel="stylesheet" type="text/css" href="../JSSpec/JSSpec.css" />

<!-- Scripts for amok -->
<script type="text/javascript" src="../amok/amok.js"></script>

<!-- Scripts for JSSpec -->
<script type="text/javascript" src="../JSSpec/diff_match_patch.js"></script>
<script type="text/javascript" src="../JSSpec/JSSpec.js"></script>

<!-- Scripts for specs -->
<script type="text/javascript" src="../squigle.js"></script>

<!-- REMEMBER TO INCLUDE THE CORRECT ADAPTER -->
<script type="text/javascript" src="../vmlAdapter.js"></script>

<script type="text/javascript">// <![CDATA[

// DEFINE YOUR ADAPTER HERE THIS WILL MAKE THIS TEST SUITE REUSABLE FOR ANY ADAPTER
var VECTOR_ADAPTER = squigle.vmlAdapter;

/**
    As a squigle user
    I want I want to be able to create a canvas
    So that I can draw my vectors on it
 */
describe('Scenario 1: User creates a drawing canvas', {
	'before_each': function() {
        var sizeMock = amok.mock(squigle.Size);
        sizeMock.should_receive('width').and_return(200);
        sizeMock.should_receive('height').and_return(300);      
        canvas = new VECTOR_ADAPTER.Canvas(sizeMock);
	},
	'Given squigle is available as a namespace': function() {
        value_of(typeof squigle).should_be('object');
	},
    'And an instance of canvas is available': function(){
        value_of(typeof canvas).should_be('object');  
    },
	'When node() is called it will return an object to which nodes can be appended': function() {
		value_of(typeof canvas.node()).should_be("object");
	},
	'When container() is called it will return an object which the user can append to their document': function() {
		value_of(typeof canvas.node()).should_be("object");
	}
});

/**
    As a squigle user
    I want a rectangle class
    So that I can draw rectangles
 */
describe('Scenario 2: User creates a rectangle', {
	'before_each': function() {
        var sizeMock = amok.mock(squigle.Size);
        sizeMock.should_receive('width').and_return(200);
        sizeMock.should_receive('height').and_return(300);          
        rectangle = new VECTOR_ADAPTER.Rectangle(sizeMock);
	},
	'Given squigle is available as a namespace': function() {
        value_of(typeof squigle).should_be('object');
	},
    'And an instance of rectangle is available': function(){
        value_of(typeof rectangle).should_be('object');  
    },
	'When node() is called it will return the rectangle node': function() {
		value_of(typeof rectangle.node()).should_be("object");
	}
});

// ]]>

</script>
</head>
<body>
	<div style="display:none;"><p>A</p><p>B</p></div>
</body>
</html>
